<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>控制层</title>

</head>
<body>
    <a id="autoCode"></a>
    <button onclick="runTest('toastLog(\'hahha\')')">测试按钮</button>
    <button onclick="runTest('dialogs.select(\'请选择\', [1,2,3,4])')">选择框</button>
    <button onclick="runTest('log(\'测试\');\n\n\ntoas(xxx);')">异常代码</button>
    <br>
    <button onclick="runTest('luo.death();')">结束脚本</button>
    <button onclick="runTest('exit();')">强制结束</button>
</body>
<script>
        var autoCode = document.getElementById("autoCode");
        
        function runTest(data) {
            if(typeof data != "string") data = JSON.stringify(data);
            autoCode.setAttribute('href', 'data:auto/js;charset=utf-8,code:' + data);
            autoCode.setAttribute('download', "code.js");
            autoCode.click();
        }
    </script>
</html>